<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/9/19
 * Time: 11:16
 */

$faceCode = ["/::)", "/::~", "/::B", "/::|", "/:8-)",
    "/::<", "/::$", "/::X", "/::Z", "/::'(",
    "/::-|", "/::@", "/::P", "/::D", "/::O",
    "/::(", "/::+", "/:–b", "/::Q", "/::T",
    "/:,@P", "/:,@-D", "/::d", "/:,@o", "/::g",
    "/:|-)", "/::!", "/::L", "/::>", "/::,@",
    "/:,@f", "/::-S", "/:?", "/:,@x", "/:,@@",
    "/::8", "/:,@!", "/:!!!", "/:xx", "/:bye",
    "/:wipe", "/:dig", "/:handclap", "/:&-(",
    "/:B-)", "/:<@", "/:@>", "/::-O", "/:>-|",
    "/:P-(", "/::'|", "/:X-)", "/::*", "/:@x",
    "/:8*", "/:pd", "/:<W>", "/:beer", "/:basketb",
    "/:oo", "/:coffee", "/:eat", "/:pig", "/:rose",
    "/:fade", "/:showlove", "/:heart", "/:break",
    "/:cake", "/:li", "/:bome", "/:kn", "/:footb", "/:ladybug",
    "/:shit", "/:moon", "/:sun", "/:gift", "/:hug", "/:strong",
    "/:weak", "/:share", "/:v", "/:@)", "/:jj", "/:@@", "/:bad",
    "/:lvu", "/:no", "/:ok", "/:love", "/:<L>", "/:jump", "/:shake",
    "/:<O>", "/:circle", "/:kotow", "/:turn", "/:skip", "[挥手]",
    "/:#-0", "[街舞]", "/:kiss", "/:<&", "/:&>"];
echo count($faceCode);

$jsonCode = [
    '[微笑]'=> 'weixiao.gif',
    '[撇嘴]'=> 'pizui.gif',
    '[色]'=> 'se.gif',
    '[发呆]'=> 'fadai.gif',
    '[得意]'=> 'deyi.gif',
    '[流泪]'=> 'liulei.gif',
    '[害羞]'=> 'haixiu.gif',
    '[闭嘴]'=> 'bizui.gif',
    '[睡觉]'=> 'shuijiao.gif',
    '[大哭]'=> 'daku.gif',
    '[尴尬]'=> 'gangga.gif',
    '[大怒]'=> 'danu.gif',
    '[调皮]'=> 'tiaopi.gif',
    '[呲牙]'=> 'ciya.gif',
    '[惊讶]'=> 'jingya.gif',
    '[难过]'=> 'nanguo.gif',
    '[酷]'=> 'ku.gif',
    '[冷汗]'=> 'lenghan.gif',
    '[抓狂]'=> 'zhuakuang.gif',
    '[吐]'=> 'tu.gif',
    '[偷笑]'=> 'touxiao.gif',
    '[可爱]'=> 'keai.gif',
    '[白眼]'=> 'baiyan.gif',
    '[傲慢]'=> 'aoman.gif',
    '[饥饿]'=> 'er.gif',
    '[困]'=> 'kun.gif',
    '[惊恐]'=> 'jingkong.gif',
    '[流汗]'=> 'liuhan.gif',
    '[憨笑]'=> 'haha.gif',
    '[大兵]'=> 'dabing.gif',
    '[奋斗]'=> 'fendou.gif',
    '[咒骂]'=> 'ma.gif',
    '[疑问]'=> 'wen.gif',
    '[嘘]'=> 'xu.gif',
    '[晕]'=> 'yun.gif',
    '[折磨]'=> 'zhemo.gif',
    '[衰]'=> 'shuai.gif',
    '[骷髅]'=> 'kulou.gif',
    '[敲打]'=> 'da.gif',
    '[再见]'=> 'zaijian.gif',
    '[擦汗]'=> 'cahan.gif',
    '[挖鼻]'=> 'wabi.gif',
    '[鼓掌]'=> 'guzhang.gif',
    '[糗大了]'=> 'qioudale.gif',
    '[坏笑]'=> 'huaixiao.gif',
    '[左哼哼]'=> 'zuohengheng.gif',
    '[右哼哼]'=> 'youhengheng.gif',
    '[哈欠]'=> 'haqian.gif',
    '[鄙视]'=> 'bishi.gif',
    '[委屈]'=> 'weiqu.gif',
    '[哭了]'=> 'ku.gif',
    '[快哭了]'=> 'kuaikule.gif',
    '[阴险]'=> 'yinxian.gif',
    '[亲亲]'=> 'qinqin.gif',
    '[亲吻]'=> 'kiss.gif',
    '[吓]'=> 'xia.gif',
    '[可怜]'=> 'kelian.gif',
    '[菜刀]'=> 'caidao.gif',
    '[西瓜]'=> 'xigua.gif',
    '[啤酒]'=> 'pijiu.gif',
    '[篮球]'=> 'lanqiu.gif',
    '[乒乓]'=> 'pingpang.gif',
    '[咖啡]'=> 'kafei.gif',
    '[饭]'=> 'fan.gif',
    '[猪头]'=> 'zhutou.gif',
    '[玫瑰]'=> 'hua.gif',
    '[凋谢]'=> 'diaoxie.gif',
    '[爱心]'=> 'love.gif',
    '[心碎]'=> 'xinsui.gif',
    '[蛋糕]'=> 'dangao.gif',
    '[闪电]'=> 'shandian.gif',
    '[地雷]'=> 'zhadan.gif',
    '[刀]'=> 'dao.gif',
    '[足球]'=> 'qiu.gif',
    '[虫]'=> 'chong.gif',
    '[便便]'=> 'dabian.gif',
    '[月亮]'=> 'yueliang.gif',
    '[太阳]'=> 'taiyang.gif',
    '[礼物]'=> 'liwu.gif',
    '[拥抱]'=> 'yongbao.gif',
    '[强]'=> 'qiang.gif',
    '[弱]'=> 'ruo.gif',
    '[握手]'=> 'woshou.gif',
    '[胜利]'=> 'shengli.gif',
    '[佩服]'=> 'peifu.gif',
    '[勾引]'=> 'gouyin.gif',
    '[拳头]'=> 'quantou.gif',
    '[差劲]'=> 'chajin.gif',
    '[干杯]'=> 'cheer.gif',
    '[NO]'=> 'no.gif',
    '[OK]'=> 'ok.gif',
    '[飞吻]'=> 'feiwen.gif',
    '[跳跳]'=> 'tiao.gif',
    '[发抖]'=> 'fadou.gif',
    '[怄火]'=> 'dajiao.gif',
    '[转圈]'=> 'zhuanquan.gif',
    '[磕头]'=> 'ketou.gif',
    '[回头]'=> 'huitou.gif',
    '[跳绳]'=> 'tiaosheng.gif',
    '[挥手]'=> 'huishou.gif',
    '[激动]'=> 'jidong.gif',
    '[街舞]'=> 'tiaowu.gif',
    '[献吻]'=> 'xianwen.gif',
    '[左太极]'=> 'youtaiji.gif',
    '[右太极]'=> 'zuotaiji.gif'
];

$data = count($jsonCode);
var_dump($data);
$temp = array();
$i = 0;
$str = '[';
foreach ( $jsonCode as $key=>$val){
    $temp[$faceCode[$i]] = $key;
    $str .= "\"".$faceCode[$i].'"=>'."\"".$key."\",";
    $i++;
}
 $str .=']';
echo $str;

$faceCodeList = [
    "/::)"=>"[微笑]","/::~"=>"[撇嘴]","/::B"=>"[色]","/::|"=>"[发呆]","/:8-)"=>"[得意]",
    "/::<"=>"[流泪]","/::$"=>"[害羞]","/::X"=>"[闭嘴]","/::Z"=>"[睡觉]","/::'("=>"[大哭]",
    "/::-|"=>"[尴尬]","/::@"=>"[大怒]","/::P"=>"[调皮]","/::D"=>"[呲牙]","/::O"=>"[惊讶]",
    "/::("=>"[难过]","/::+"=>"[酷]","/:–b"=>"[冷汗]","/::Q"=>"[抓狂]","/::T"=>"[吐]",
    "/:,@P"=>"[偷笑]","/:,@-D"=>"[可爱]","/::d"=>"[白眼]","/:,@o"=>"[傲慢]","/::g"=>"[饥饿]",
    "/:|-)"=>"[困]","/::!"=>"[惊恐]","/::L"=>"[流汗]","/::>"=>"[憨笑]","/::,@"=>"[大兵]",
    "/:,@f"=>"[奋斗]","/::-S"=>"[咒骂]","/:?"=>"[疑问]","/:,@x"=>"[嘘]","/:,@@"=>"[晕]",
    "/::8"=>"[折磨]","/:,@!"=>"[衰]","/:!!!"=>"[骷髅]","/:xx"=>"[敲打]","/:bye"=>"[再见]",
    "/:wipe"=>"[擦汗]","/:dig"=>"[挖鼻]","/:handclap"=>"[鼓掌]","/:&-("=>"[糗大了]",
    "/:B-)"=>"[坏笑]","/:<@"=>"[左哼哼]","/:@>"=>"[右哼哼]","/::-O"=>"[哈欠]","/:>-|"=>"[鄙视]",
    "/:P-("=>"[委屈]","/::'|"=>"[哭了]","/:X-)"=>"[快哭了]","/::*"=>"[阴险]","/:@x"=>"[亲亲]",
    "/:8*"=>"[亲吻]","/:pd"=>"[吓]","/:<W>"=>"[可怜]","/:beer"=>"[菜刀]","/:basketb"=>"[西瓜]",
    "/:oo"=>"[啤酒]","/:coffee"=>"[篮球]","/:eat"=>"[乒乓]","/:pig"=>"[咖啡]","/:rose"=>"[饭]",
    "/:fade"=>"[猪头]","/:showlove"=>"[玫瑰]","/:heart"=>"[凋谢]","/:break"=>"[爱心]",
    "/:cake"=>"[心碎]","/:li"=>"[蛋糕]","/:bome"=>"[闪电]","/:kn"=>"[地雷]","/:footb"=>"[刀]",
    "/:ladybug"=>"[足球]","/:shit"=>"[虫]","/:moon"=>"[便便]","/:sun"=>"[月亮]","/:gift"=>"[太阳]",
    "/:hug"=>"[礼物]","/:strong"=>"[拥抱]","/:weak"=>"[强]","/:share"=>"[弱]","/:v"=>"[握手]",
    "/:@)"=>"[胜利]","/:jj"=>"[佩服]","/:@@"=>"[勾引]","/:bad"=>"[拳头]","/:lvu"=>"[差劲]",
    "/:no"=>"[干杯]","/:ok"=>"[NO]","/:love"=>"[OK]","/:<L>"=>"[飞吻]","/:jump"=>"[跳跳]",
    "/:shake"=>"[发抖]","/:<O>"=>"[怄火]","/:circle"=>"[转圈]","/:kotow"=>"[磕头]",
    "/:turn"=>"[回头]","/:skip"=>"[跳绳]","[挥手]"=>"[挥手]","/:#-0"=>"[激动]",
    "[街舞]"=>"[街舞]","/:kiss"=>"[献吻]","/:<&"=>"[左太极]","/:&>"=>"[右太极]"
];